package org.icy.core.setup.verification;

import org.icy.core.setup.VerificationResult;

public class JVMVerification implements Verification {

	@Override
	public VerificationResult verify() {
		String current = System.getProperty("java.version");
		String[] parts = current.split("\\.");
		int major = Integer.parseInt(parts[0]);
		int minor = Integer.parseInt(parts[1]);
		if (major > 1 || (major == 1 && minor >= 6))
			return new VerificationResult(true, current, "Java", null);
		return new VerificationResult(false, current, "Java", "Icy requires Java 6 or above to work");
	}

}
